home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / perfTuning / ChallengeIO / Disk.perf.disk / graph_step < prev    next >
Encoding:
Text File  |  1994-08-02  |  4.2 KB  |  143 lines

  1. #!/bin/sh
  2.  
  3. # Expects one parameter which is the name of the file containing
  4. # the performance data.
  5.  
  6. # On stdout it produces a table of the results - discarding the lowest and
  7. # highest, then averaging the remainder.
  8.  
  9. # Leaves perf.4seg, perf.1seg
  10. # Creates graph.sr, graph.sw, graph.sc which are shell scripts
  11. #    to display the graphs of read, write, create.
  12.  
  13. # Each graph has an entry 0 0.0 forced in to give an origin. Could be removed.
  14.  
  15. cat <<'EOF' >/usr/tmp/d.awk$$
  16. BEGIN            { cnt = 0; max=0.0; min=1000.1; maxi=0.0; mini=1000.1;
  17.                 ndisks=0; rawefs="?"; async="?"; direct="?";
  18.                 nthrd=0; xfrsz=0; stepsz=0; xfrtyp="?";
  19.                 sr="?"; mbs=0.0; iops=0.0;
  20.             }
  21. /^#TITLE/        { ttl1=$2; ttl2=$3; ttl3=$4; ttl4=$5; ttl5=$6;
  22.             }
  23. / way stripe, step/    { ndisks=$1; stepsz=$6;
  24.                 cnt = 0; max=0.0; min=1000.1; maxi=0.0;
  25.                 mini=1000.1; rawefs="R"; async="?";
  26.                 direct=" "; nthrd=0; xfrsz=0;
  27.                 xfrtyp="?"; sr="?"; mbs=0.0; iops=0.0;
  28.                 if ( stepsz == 128 ) {
  29.                     printf "\n%s %s %s %s %s\n", ttl1, ttl2, ttl3, ttl4, ttl5;
  30.                     printf "step    #     # R/A/D    #    transfer  #    OS R/W seq  MB/sec IOP/sec\n";
  31.                     printf "size  busses LV  E/M  threads   size   disk rev  C  rand\n";
  32.                 }
  33.             }
  34. /^$/            {prline();}
  35. /^mkfs/            {rawefs="E";}
  36. /^.usr.disk.sio -V -A/    {nthrd=$4; async="A";
  37.                 if ( $5 == "-D" ) {
  38.                     direct="D";
  39.                 }
  40.             }
  41. /^sequential create/    {prline(); sr="S"; xfrtyp="C"; xfrsz=$4; }
  42. /^sequential write/    {prline(); sr="S"; xfrtyp="W"; xfrsz=$4; }
  43. /^sequential read/    {prline(); sr="S"; xfrtyp="R"; xfrsz=$4; }
  44. /blocks.*KB.*MB.*IO/    {mbs += $8; iops += $11; cnt++;
  45.                 if ( $8 > max ) {
  46.                     max = $8;
  47.                 }
  48.                 if ( $8 < min ) {
  49.                     min = $8;
  50.                 }
  51.                 if ( $11 > maxi ) {
  52.                     maxi = $11;
  53.                 }
  54.                 if ( $11 < mini ) {
  55.                     mini = $11;
  56.                 }
  57.             }
  58.  
  59. #            {}
  60.  
  61. function prline() {
  62.     if ( cnt != 0 ) {
  63.         printf "%4d   %3d    1  %cM%c%c %4d    %6d   %3d  5.2  %c  %3s %6.2f %5.2f\n", stepsz, ndisks/4, rawefs, async, direct, nthrd, xfrsz, ndisks, xfrtyp, sr, (mbs-max-min)/(cnt-2), (iops-maxi-mini)/(cnt-2);
  64.     }
  65.     cnt = 0; max=0.0; min=1000.1; maxi=0.0; mini=1000.1;
  66.     mbs=0.0; iops=0.0;
  67. }
  68.  
  69. END    {
  70.         prline();
  71.     }
  72.  
  73. EOF
  74. sed -e 's/[()]//g' -e 's/^------* /#TITLE /' -e 's/^\(#TITL.*\) -----*$/\1/' $1 | nawk -f /usr/tmp/d.awk$$ |tee /usr/tmp/d.res$$
  75. rm -f /usr/tmp/d.awk$$
  76. #Split into perf.4seg, perf.1seg
  77. sed -e '1,/^Dir.*4/d' -e '1,2d' -e '/^$/,$d' /usr/tmp/d.res$$|sort -n >perf.4seg
  78. sed -e '1,/^Dir.*1/d' -e '1,2d' -e '/^$/,$d' /usr/tmp/d.res$$|sort -n >perf.1seg
  79. #Start of graph ------------------------------------------------
  80. #Start of write graph ------------------------------------------------
  81. cat <<EOF >graph.sw
  82. #!/bin/sh
  83. exec xgraph -t "Write" -x "step size" -y "MBytes/sec" <<EOD
  84. "Direct 4 segment"
  85. 0 0.0
  86. EOF
  87. grep '^ .* W ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* W *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sw
  88. cat <<EOF >>graph.sw
  89.  
  90. "Direct 1 segment"
  91. 0 0.0
  92. EOF
  93. grep '^ .* W ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* W *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sw
  94. cat <<EOF >>graph.sw
  95.  
  96. EOD
  97. EOF
  98. chmod 755 graph.sw
  99. ./graph.sw&
  100. #End of Write graph ------------------------------------------------
  101. #Start of Read graph ------------------------------------------------
  102. cat <<EOF >graph.sr
  103. #!/bin/sh
  104. exec xgraph -t "Read" -x "step size" -y "MBytes/sec" <<EOD
  105. "Direct 4 segment"
  106. 0 0.0
  107. EOF
  108. grep '^ .* R ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* R *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sr
  109. cat <<EOF >>graph.sr
  110.  
  111. "Direct 1 segment"
  112. 0 0.0
  113. EOF
  114. grep '^ .* R ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* R *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sr
  115. cat <<EOF >>graph.sr
  116.  
  117. EOD
  118. EOF
  119. chmod 755 graph.sr
  120. ./graph.sr&
  121. #End of Read graph ------------------------------------------------
  122. #Start of Create graph ------------------------------------------------
  123. cat <<EOF >graph.sc
  124. #!/bin/sh
  125. exec xgraph -t "Create" -x "step size" -y "MBytes/sec" <<EOD
  126. "Direct 4 segment"
  127. 0 0.0
  128. EOF
  129. grep '^ .* C ' perf.4seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* C *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sc
  130. cat <<EOF >>graph.sc
  131.  
  132. "Direct 1 segment"
  133. 0 0.0
  134. EOF
  135. grep '^ .* C ' perf.1seg | sort -n | sed -e 's/^ *\([0-9][0-9]*\) .* C *S *\([0-9][0-9\.]*\) .*$/\1 \2/' >>graph.sc
  136. cat <<EOF >>graph.sc
  137.  
  138. EOD
  139. EOF
  140. chmod 755 graph.sc
  141. ./graph.sc&
  142. #End of Create graph ------------------------------------------------
  143.